
<div class="layui-fluid">
    <div class="layui-card">
        <form class="layui-form layui-card-header layuiadmin-card-header-auto" id="dev-errorLog-search-form" lay-filter="dev-errorLog-search-form">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label"></label>
                    <div class="layui-input-inline">
                        <input type="text" name="CreatedOn_0" condition=">=" compare="CreatedOn" placeholder="" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid">-</div>
                    <div class="layui-input-inline">
                        <input type="text" name="CreatedOn_1" condition="<=" compare="CreatedOn" placeholder="" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </form>
        <div class="layui-card-body">

            <table id="dev-errorLog-table" lay-filter="dev-errorLog-table"></table>

            <script type="text/html" id="dev-errorLog-toolbar"></script>
        </div>
    </div>
</div>

<script>
    layui.use(['reTable', 'laydate'], function () {
        var $ = layui.$
            , laydate = layui.laydate
            , reTable = layui.reTable
            , admin = layui.admin;

        laydate.render({
            elem: '#dev-errorLog-search-form [name="CreatedOn_0"]',
            trigger: 'click',
            type: 'datetime',
            lang: layui.admin.lang ? 'en' : '',
            format: 'yyyy-MM-dd HH:mm'
        });
        laydate.render({
            elem: '#dev-errorLog-search-form [name="CreatedOn_1"]',
            trigger: 'click',
            type: 'datetime',
            lang: layui.admin.lang ? 'en' : '',
            format: 'yyyy-MM-dd HH:mm'
        });

        reTable.initTable({
            tableId: 'dev-errorLog'
            , tableOptions: {
                url: '/Admin/getErrorLogList'
                , idField: 'LogID'
                , where: { order: 'CreatedOn desc' }
                , initSort: { field: 'CreatedOn', type: 'desc' }
                , cellMinWidth: 140
                , cols: [[
                    { type: 'checkbox', fixed: 'left' }
                    , { field: 'UserNo', title: '账号', sort: true, width: 200 }
                    , { field: 'UserName', title: '用户姓名', sort: true }
                    , { field: 'Type', title: '错误类型', align: 'center', sort: true }
                    , { field: 'Title', title: '错误名称', align: 'center', sort: true }
                    , {
                        field: 'CreatedOn', title: '请求时间', 'sort': true, width: 160, align: 'center'
                        , templet: function (d) { return admin.timeFormat_YMDHMS(d.CreatedOn); }
                    }
                    , { field: 'IPAddress', title: '请求IP', sort: true }
                    , { field: 'Remarks', title: '描述', sort: true, width: 400 }
                    , { title: admin.operationCell, width: 120, align: 'center', fixed: 'right', toolbar: '#dev-errorLog-toolbar' }
                ]]
            }
            , delUrl: '/Admin/delErrorLog'
            , clearUrl: '/Admin/clearErrorLog'
            , toolFun: {}
            , toolbarFun: {}
            , formOptions: {
                url: 'admin/dev/errorLogForm'
            }
        });
    });
</script>